package assig2;

import java.util.Date;

public class Cartoon extends Drawing{
	protected Person penciller; 
	protected Person inker;
	protected Person colorist; 
	
	
	/**
	 * @return the penciller
	 */
	public Person getPenciller() {
		return penciller;
	}

	/**
	 * @return the inker
	 */
	public Person getInker() {
		return inker;
	}

	/**
	 * @return the colorist
	 */
	public Person getColorist() {
		return colorist;
	}

	/**
	 * @param penciller the penciller to set
	 */
	public void setPenciller(Person penciller) {
		this.penciller = penciller;
	}

	/**
	 * @param inker the inker to set
	 */
	public void setInker(Person inker) {
		this.inker = inker;
	}

	/**
	 * @param colorist the colorist to set
	 */
	public void setColorist(Person colorist) {
		this.colorist = colorist;
	}

	/** Default constructor
	 * 
	 */
	Cartoon () {
		// Note: Default constructor of parent is invoked automatically
		penciller = null;
		inker = null;
		colorist = null;
	}
	
	/** A more complete constructor!
	 * @param creationDate
	 * @param ownerName 
	 * @param ownerId
	 * @param height Vertical dimension in inches
	 * @param width Horizontal dimesnion in inches
	 */
	Cartoon(Date creationDate, String ownerName, long ownerId,
			double height, double width, Person pencillerPerson,
			Person inkerPerson, Person coloristPerson) {
		// Instead of the default constructor, explicitly invoke 
		// the parent constructor with proper parameters
		super(creationDate, ownerName, ownerId, height, width);
		this.penciller = pencillerPerson;
		this.inker = inkerPerson;
		this.colorist = coloristPerson;
	}	
	
	/**
	 * @return String version of the object
	 */
	public String toString() {
		String s; // Return string to construct;
		s = super.toString(); // Invoke toString() of parent class
		
		// Handle the artist, if any
		if (this.penciller == null) {
			s = s + " by anonymous penciler";
		} else {
			s = s + " by penciler: " + this.penciller;
		}
		if (this.penciller == null) {
			s = s + " anonymous inker";
		} else {
			s = s + " inker: " + this.inker;
		}
		if (this.penciller == null) {
			s = s + " and anonymous colorist";
		} else {
			s = s + " and colorist: " + this.colorist;
		}
		return s;
	}
}
